Skip to content

Conversation

SkylerBleu
Copy link

@SkylerBleu SkylerBleu commented Feb 27, 2019

Hello, I'm requesting this extra regex option get added to cucumber.rb to fix an issue I'm having with Scenario Outlines.

Here is an example:

Scenario Outline: Example of scenario outline issue
      Given User makes GET request to "www.give-me-a-json.com/api/json"
      And   User receives 200 response code
      Then  the JSON response at "data/someInteger" should be <integer>
      
      Examples:
      | integer |
      | 5       |

^^^ The above will give me an undefined step reference error while conversely....

Scenario: Example of scenario outline issue
      Given User makes GET request to "www.give-me-a-json.com/api/json"
      And   User receives 200 response code
      Then  the JSON response at "data/someInteger" should be 5

This will work fine. Adding <.*> will allow for examples table entries to be read, regardless of quotations. It's also an improvement because if the value passed in by the examples table doesn't follow the regex, then it will throw a runtime error.

Hello, I'm requesting this extra regex option get added to cucumber.rb to fix an issue I'm having with Scenario Outlines.

Here is an example:
```
Scenario Outline: Example of scenario outline issue
      Given User makes GET request to "www.give-me-a-json.com/api/json"
      And   User receives 200 response code
      Then  the JSON response at "data/someInteger" should be <integer>
      
      Examples:
      | integer |
      | 5       |
```
^^^ The above will give me an undefined step reference error while conversely.... 
```
Scenario: Example of scenario outline issue
      Given User makes GET request to "www.give-me-a-json.com/api/json"
      And   User receives 200 response code
      Then  the JSON response at "data/someInteger" should be 5
```
This will work fine. Adding <.*> will allow for examples table entries to be read, regardless of quotations. There may have to be an extra check within the method to account for someone trying to pass in a string without quotations using the examples table, which I'd be happy to provide if requested.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant